﻿<?php
$condition = '1=1';
if(!empty($keyword))
	$condition .= " and usernamae like '%" .$keyword. "%'";
else
	$keyword = '';
?>
<div class="pageContent">	
	<div class="pageContent">
		<div class="pageHeader">
			<form action="admin.php?m=ucenter&c=admin" method="post" onsubmit="return navTabSearch(this)" >
			<div class="searchBar">
				<ul class="searchContent">
					<li><label>信息检索：</label><input name="keyword" class="ipt" type="text" placeholder="搜索关键字"/></li>                        
					<li class="subBar" style="width:60px">
						<div class="buttonActive">
							<div class="buttonContent"><button type="submit">检索</button></div>
						</div>
					</li>
				</ul>		
			</div>
			</form>
		</div>
		<div class="panelBar" style="border-top:0">
			<ul class="toolBar">
				<li><a class="add" target="dialog" lang="ucenter" rel="addadmin" width="420" height="194"><span>添加管理员</span></a></li>
				<li><a class="edit" target="dialog" lang="ucenter" rel="editadmin" ids="{sltobj}" width="420" height="194"><span>修改管理员</span></a></li>
				<li><a class="delete" target="selectedTodo" lang="purge"  rel="admin" ids="ids" pos="2" postType="string"  title="确实要删除这些记录吗?"><span>批量删除管理员</span></a></li>								
			</ul>
		</div>
		<table class="list" width="100%" layoutH="90">
			<thead>
				<tr>
					<th width="3%"><input type="checkbox" group="ids" class="checkboxCtrl"/></th>
					<th width="40">序号</th>
					<th>用户名称</th>
					<th width="180">用户角色</th>
					<th width="180">登录次数</th>
					<th width="180">创建时间</th>
					<th width="180">最后登录日期</th>                                
					<th width="180">最后登录地址</th>
					<th width="120">操作</th>
				</tr>
			</thead>
			<tbody>
			<?php
				$list = $tpl->GetInfoList('admin',0,1,'id','desc');
				if(count($list>0))
				{
					foreach($list as $k => $v)
					{
						echo '<tr target="sltobj" rel="'.$v['id'].'">
						<td><input name="ids" type="checkbox" value="'.$v['id'].'" /></td>
						<td>'.($k+1).'</td>
						<td>'.$v['username'].'</td>
						<td>'.$v['type'].'</td>
						<td>'.$v['logintotal'].'</td>
						<td>'.date('Y-m-d H:i:s',$v['cdatetimes']).'</td>
						<td>'.date('Y-m-d H:i:s',$v['udatetimes']).'</td>
						<td>'.$v['loginip'].'</td>
						<td>
							<a class="btnEdit" target="dialog" lang="ucenter" rel="editadmin" ids="'.$v['id'].'" width="420" height="194" title="修改管理员">编辑</a>							
							<a class="btnDel" target="ajaxTodo" lang="purge" rel="admin" ids="'.$v['id'].'" pos="1"  title="确定要删除当前信息吗?">删除</a>
						</td>
					</tr>';	
					}
				}
				else
					echo '<tr><td colspan="8"><font>暂无相关信息</font></td></tr>';
			?>	                
			</tbody>
		</table>
	</div>
</div>
